home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / tests / breakpoints.tst < prev    next >
Text File  |  1999-09-16  |  2KB  |  112 lines

  1. mode(-1)
  2. //
  3. // (setbpt delbpt).
  4. deff('[]=lig()',[
  5. 'shlig(2),';
  6. 'if 1>2 then,';
  7. '  shlig(4),';
  8. ',';
  9. '  shlig(6)     ,'; // break-point
  10. ',';
  11. 'end,shlig(8)   ,'; // break-point
  12. 'shlig(9),';
  13. 'for k=1:3,';
  14. '  k;shlig(11)  ,'; // break-point 
  15. 'end,shlig(12)  ,'; // break-point
  16. ',';
  17. 'for l=1:10,';
  18. '  if l=5 then break,end,';
  19. '  l,';
  20. 'end,shlig(17)  ,'; // break-point
  21. 'shlig(18),';
  22. 'select 2,';
  23. 'case 1 then,';
  24. ',';
  25. 'case 2 then,';
  26. '  shlig(23)   ,'; // break-point
  27. 'case 3 then,';
  28. '1,';
  29. 'else,';
  30. '2,';
  31. 'end,shlig(28) ,'; // break-point
  32. 'shlig(29),';
  33. 'select 0,';
  34. 'case 1 then,';
  35. '1,';
  36. 'case 2 then,';
  37. '2,';
  38. 'case 3 then,';
  39. '3,';
  40. 'else,';
  41. '  shlig(38)  ,'; // break-point
  42. 'end,shlig(39),'; // break-point
  43. 'shlig(40)    ,'; // break-point
  44. 'i=0,';
  45. 'while i<3,';
  46. 'i=i+1,shlig(43) ,'; // break-point 
  47. 'end,shlig(44) ,'; //break-point
  48. 'i=0;,';
  49. 'while i<10,';
  50. 'i=i+1,if i=2 then break,end,shlig(47),';
  51. 'end,shlig(48) ,' //break-point
  52. ])
  53. deff('[]=shlig(n)','write(%io(2),''ligne ''+string(n))')
  54.  
  55. //definition des points d'arrets
  56. setbpt('lig',6)
  57. setbpt('lig',8)
  58. setbpt('lig',11)
  59. setbpt('lig',12)
  60. setbpt('lig',17)
  61. setbpt('lig',23)
  62. setbpt('lig',28)
  63. setbpt('lig',38)
  64. setbpt('lig',39)
  65. setbpt('lig',40)
  66. setbpt('lig',43)
  67. setbpt('lig',44)
  68. setbpt('lig',48)
  69. write(%io(2),[
  70. 'user should check the line number'])
  71. write(%io(2),[' ';'MACRO NOT COMPILED';'-----------------';' '])
  72. lig()
  73. resume
  74. resume
  75. resume
  76. resume
  77. resume
  78. resume
  79. resume
  80. resume
  81. resume
  82. resume
  83. resume
  84. resume
  85. resume
  86. resume
  87. resume
  88. resume
  89.  
  90. comp(lig)
  91. write(%io(2),[' ';'COMPILED MACRO';'-----------------';' '])
  92. lig()
  93. resume
  94. resume
  95. resume
  96. resume
  97. resume
  98. resume
  99. resume
  100. resume
  101. resume
  102. resume
  103. resume
  104. resume
  105. resume
  106. resume
  107. resume
  108. resume
  109. delbpt('lig')
  110. clear lig shlig
  111.  
  112.